home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld: Complete Mac Interactive
/
Macworld Complete Mac Interactive CD)(1994).iso
/
The Best of BMUG
/
Utilities
/
Text and Speech
/
Alpha.5.76
/
Tcl
/
SystemCode
/
flags.tcl
< prev
next >
Wrap
Text File
|
1994-03-11
|
3KB
|
143 lines
set flagFlags ""
# The following three procs, together w/ the initialization
# for the flags below, allow a totally Tcl-controlled menu to
# shadow Alpha's internal variables.
proc initFlag var {
global $var flagFlags
addMenuItem -m Flags $var
linkVar $var
lappend flagFlags $var
}
# Called for ordinary tcl global vars we want included in the Flags menu.
proc initTclFlag {flag {val 0}} {
global $flag flagFlags
addMenuItem -m Flags $flag
if {![info exists $flag]} {set $flag $val}
lappend flagFlags $flag
}
# Called for ordinary tcl global vars we want included in the Vars menu.
proc initTclVar {var {val ""}} {
global $var
if {[string length $val]} {
set $var $val
}
addMenuItem -m Vars $var
if {![info exists $var]} {set $var 0}
}
# 'fullNames' needs to be traced to update win menu.
if {![info exists oldFNames]} {set oldFNames 0}
proc shadowFullNames args {
global winNameToNum fullNames oldFNames winMenu
if {$fullNames == $oldFNames} {return $fullNames}
set oldFNames $fullNames
if {[catch {set nms [array names winNameToNum]}] == "1"} {
return $fullNames
}
if {$fullNames == "1"} {
foreach name $nms {
if {$winNameToNum($name) < 10} {
set lab /$winNameToNum($name)
} else {set lab ""}
regexp {[^:]*$} $name nm
catch {deleteMenuItem -m $winMenu $nm}
addMenuItem -m -l $lab $winMenu $name
}
} else {
foreach name $nms {
if {$winNameToNum($name) < 10} {
set lab /$winNameToNum($name)
} else {set lab ""}
regexp {[^:]*$} $name nm
catch {deleteMenuItem -m $winMenu $name}
addMenuItem -m -l $lab $winMenu $nm
}
}
return $fullNames
}
proc initVar var {
global $var
linkVar $var
addMenuItem -m Vars $var
}
# This file contains methods allowing the shadowing of tcl variables
initFlag autoHScroll
initFlag autoSave
initTclFlag backup
initFlag blockCursor
initFlag bwWindows
initFlag dragAndDrop
initFlag elecLBrace
initFlag elecRBrace
initFlag electricSemi
initFlag fullNames
trace vdelete fullNames w shadowFullNames
trace variable fullNames w shadowFullNames
initFlag fullScreen
initFlag horScrollBar
initTclFlag iconifyOnSwitch
initFlag indentOnCR
initTclFlag intelCutPaste 1
initFlag moveInsertion
initFlag openAllFiles
initFlag optionIsMeta
initFlag posActivate
initFlag powerThumb
initFlag projectorAware
initFlag showRowCol
initFlag showInvisibles
initFlag showMenuHeads
initFlag sortedIsDefault
initFlag suppressHeader
initFlag tempMem
initFlag undoOn
initFlag wordWrap
initTclVar backExtension "~"
initTclVar backDir
initVar bottomMargin
initVar changesLim
initVar defHeight
initVar defWidth
initVar defaultFont
initVar fillColumn
initVar fontSaving
initVar fontSize
initVar funcExpr
initVar funcPar
initVar leftFillColumn
initVar leftMargin
initVar markLabel
initVar markSorting
initVar numWinsToTile
initVar paraColumn
initVar printerFont
initVar printerFontSize
initVar savedState
initVar sortColumn
initVar tabSize
initVar tagFile
initVar topMargin
initVar wordBreak
initVar wordBreakPreface
# Redefine 'menuHook' to update flags menu.
proc menuHook {} {
uplevel #0 {
foreach f $flagFlags {
markMenuItem Flags $f [set $f]
}
}
}